import Vue from 'vue'
import VueRouter from 'vue-router'

const Login = () => import('@/components/common/login/Login')
const Index = () => import('@/views/Index')
const CreateEquip = () => import('@/views/equip/CreateEquip')
const EquipList = () => import('@/views/equip/EquipList')

const CreateHero = () => import('@/views/hero/CreateHero')
const HeroList = () => import('@/views/hero/HeroList')

const CreateArticle = () => import('@/views/article/CreateArticle')
const ArticleList = () => import('@/views/article/ArticleList')

const CreateAd = () => import('@/views/ad/CreateAd')
const AdList = () => import('@/views/ad/AdList')

const CreateCategory = () => import('@/views/category/CreateCategory')
const CategoryList = () => import('@/views/category/CategoryList')

const CreateAdminUser = () => import('@/views/adminUser/CreateAdminUser')
const AdminUserList = () => import('@/views/adminUser/AdminUserList')

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: Login },
  {
    path: '/',
    component: Index,
    children: [
      { path: '/create/equips', component: CreateEquip },
      { path: '/list/equips', component: EquipList },

      { path: '/create/heroes', component: CreateHero },
      { path: '/list/heroes', component: HeroList },

      { path: '/create/articles', component: CreateArticle },
      { path: '/list/articles', component: ArticleList },

      { path: '/create/ads', component: CreateAd },
      { path: '/list/ads', component: AdList },

      { path: '/create/categories', component: CreateCategory },
      { path: '/list/categories', component: CategoryList },

      { path: '/create/admin_users', component: CreateAdminUser },
      { path: '/list/admin_users', component: AdminUserList }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
